#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	double arr[5][5] = { 0 };
	int i = 0;
	int j = 0;
	double sum = 0;
	for (i = 0; i < 5; i++)
	{
		for (j = 0; j < 5; j++)
		{
			scanf("%lf", &arr[i][j]);
		}
	}
	for (i = 0; i < 5; i++)
	{
		for (j = 0; j < 5; j++)
		{
			printf("%.1lf ", arr[i][j]);
			sum += arr[i][j];
		}
		printf("%.1lf\n", sum);
		sum = 0;
	}
	return 0;
}